
#ifndef __AUDIO_PLAY_CMD_H__
#define __AUDIO_PLAY_CMD_H__

//enum EN_MP3PLAYSTATE {psMP3INIT, psMP3RUNNING, psMP3PAUSED, psMP3STOPPED, psMP3COUNTINU};

typedef enum _tagPLAY_STATUS
{
	STATUS_STOP = 0,
	STATUS_PLAY,
	STATUS_PAUSE,
	STATUS_MAX,
}CMD_PLAY_STATUS;

typedef enum _tagPLAY_MODE
{
	MODE_PLAY_ALL = 0,
	MODE_PLAY_ONE,
	MODE_PLAY_MAX,
} PLAY_MODE;

#define	WM_GRAPH_NOTIFY		(WM_APP + 1)
#define MZ_PLAYTIMER_TIME		2010

class CAudioPlayCmd
{
public:
	HWND			m_hParent;
	CRITICAL_SECTION	m_csCtrl;
	void	*m_pGB;
	void	*m_pMC;
	void	*m_pME;
	void	*m_pBA;
	void	*m_pMS;

//	EN_MP3PLAYSTATE	m_psCurrent;

public:
	CAudioPlayCmd();
	virtual ~CAudioPlayCmd();
	HRESULT OpenClip(LPTSTR szFile);
	void CloseInterfaces();
	void CloseClip();
	BOOL PauseClip();
	void StopClip();
	long GetCurPosTime();
	long GetDurationTime();
//	long GetCurPos();
//	double GetTotalPos();
	void SetPosTime(int p);
/*
	BOOL IsMoviePalyInitialize();
	BOOL IsMoviePalyRunning();
	BOOL IsMoviePalyPause();
	BOOL IsMoviePalyCountinu();
	BOOL IsMoviePalyStop();
*/	HRESULT HandleGraphEvent();
	void SetParentHandle(HWND hWnd);
	PLAY_MODE m_pmModePlay;
	void SetPlayMode(PLAY_MODE pmModePlay) {m_pmModePlay = pmModePlay;};
	PLAY_MODE GetPlayMode() {return m_pmModePlay;};

	CMD_PLAY_STATUS m_psStatusPlay;
	void OnFilePlay(TCHAR *pStrFullFileName);
	void OnFileStop();
	void OnFilePause();
	void OnFileNext(TCHAR *pStrFullFileName);
	void OnFilePrev(TCHAR *pStrFullFileName);
	TCHAR m_PlayFileName[256];
	TCHAR m_StrOldFullFileName[256];

	void SetPsStatusPlay(DWORD dwPsStatusPlay){m_psStatusPlay = (CMD_PLAY_STATUS)dwPsStatusPlay;};
	DWORD GetPsStatusPlay(){return (DWORD)m_psStatusPlay;};
};

#endif